package Maze;

import javax.swing.*;

public class Maze extends JPanel {
    private static final long serialVersionUID = -8300339045454852626L;
    private int NUM, width, padding; // NUM：迷宫大小；width：每个格子的宽度和高度
    private Lattice[][] maze;
    private int ballX, ballY; // 球的位置，在第几行第几列格子上
    private boolean drawPath = false; // flag，标识是否画出路径

    Maze(int m, int wi, int p) {
        NUM = m;
        width = wi;
        padding = p;
        maze = new Lattice[NUM][NUM];
        for (int i = 0; i < NUM; i++) {
            for (int j = 0; j < NUM; j++) {
                maze[i][j] = new Lattice(i, j);
            }
        }
//        createMaze();
//        setKeyListener();
        this.setFocusable(true);
    }
}